package com.njegovanobradovic.icet.service.hibernate;

import org.hibernate.Session;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.transaction.annotation.Transactional;

import com.njegovanobradovic.icet.service.Add;

public class AddImpl<Object> extends HibernateDaoSupport implements Add<Object> {

	private Object object;

	
	protected Session getManager() {
		return getSessionFactory().getCurrentSession();
	}
	
	@SuppressWarnings("unchecked")
	@Transactional
	public Object execute() {
		getManager().save(object);
		return object;
	}

	public Object getObject() {
		return object;
	}

	public void setObject(Object object) {
		this.object = object;
	}

	
}
